local scene = director:createScene()

function scene:setUp(event)
    dbg.print("sceneInstructions:setUp")
	
local scaleX = 320/director.displayWidth
	local scaleY = 480/director.displayHeight
	local initialY = 340/scaleY
	label = {}
		
	labelTitle = director:createLabel({x=director.displayCenterX, y=400/scaleY, text="INSTRUCTIONS", hAlignment="center", xAnchor=0.5, color=color.white, })
	labelTitle.xScale = 1/scaleX
	labelTitle.yScale = 1/scaleY
	
	for i = 1, 7 do
		initialY=initialY-40/scaleY
		label[i] = director:createLabel({x=director.displayCenterX, y=initialY, text="", hAlignment="center", xAnchor=0.5, yAnchor=0, color=color.white, })
		label[i].xScale = 1/scaleX
		label[i].yScale = 1/scaleY
	end
	
	--You must pop the balloon with the appropriate number in the correct order in the shortest time possible.
	
	label[1].text = "You must pop"
	label[2].text = "the balloon with"
	label[3].text = "the appropriate"
	label[4].text = "number in the"
	label[5].text = "correct order"
	label[6].text = "in the shortest"
	label[7].text = "time possible."

		
	local buttonBack = director:createSprite(250/scaleX, 18/scaleY, "img/button.png")
	buttonBack.xAnchor=0.5; buttonBack.yAnchor=0.5
	buttonBack.xScale=.5/scaleX; buttonBack.yScale=.3/scaleY
	labelBack = director:createLabel(250/scaleX, 6/scaleY, "Back")
	labelBack.xAnchor=0.5;
	labelBack.zOrder = buttonBack.zOrder
	labelBack. hAlignment="center"
	labelBack.xScale = 1/scaleX
	labelBack.yScale = 1/scaleY
	
	function buttonBack:touch(event)
		if (event.phase == 'began') then
			system:sendEvent("moveToSceneMenu")
		end
	end
	buttonBack:addEventListener('touch', buttonBack)
end

function scene:tearDown(event)
    dbg.print("sceneInstructions:tearDown")
end

scene:addEventListener({"setUp", "tearDown"}, scene)

return scene -- We must return the scene object!